import { http } from "@/utils/http";
import { vapUrlApi } from "../utils";

export type GuaProperty = {
  id: string;
  scope: string;
  key: string;
  value: string;
};

// 查询gua的属性配置
export const findGuaProperties = () => {
  return http.request<GuaProperty[]>(
    "get",
    vapUrlApi("settings/findGuaProperties")
  );
};

// 更新gua属性配置
export const updateGuaProperty = (data?: GuaProperty) => {
  return http.request("post", vapUrlApi("settings/updateGuaProperty"), {
    data
  });
};

// 查询水印信息
export const findWatermark = () => {
  return http.request<string>("get", vapUrlApi("settings/findWatermark"));
};
// 保存水印信息
export const saveWatermark = (str?: string) => {
  return http.request("post", vapUrlApi("settings/saveWatermark"), {
    data: { value: str }
  });
};
// 获取水印内容
export const getWatermarkContext = () => {
  return http.request<string>("get", vapUrlApi("settings/getWatermarkContext"));
};
